const express = require("express")
const app = express()
const {resolve} = require("path")
// 连接数据库
require("./middleware/mongodb")

app
  .use(require("./middleware/cors"))
  .use(express.static(resolve(__dirname,'./static')))
  .use(require("./middleware/session"))
   .use(express.json())
   .use(express.urlencoded({extended: true}))
   .use("/",require("./router/index"))
   .listen(4000,()=>{
      console.log('4000端口已监听')
})

